﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SIF_2.BussinesLayer;
using SIF_2.DataLayer;
using System.Collections;
using InicioDeSesion;

namespace SIF_2
{
    public partial class fcscliente : Form
    {
        public fcscliente()
        {
            InitializeComponent();
        }

        
        private void fcscliente_Load(object sender, EventArgs e)
        {
            if (Program1.ofi)
            {
                button2.Enabled = false;                
            }            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            CustomerBL Customer = new CustomerBL();
            Customer.ObtenerCliente(TxtCedula.Text);
            
            dataGridView1.RowCount = 1;
            dataGridView1[0, dataGridView1.RowCount - 1].Value = Customer.ObtenerCliente(TxtCedula.Text).Id;
            dataGridView1[1, dataGridView1.RowCount - 1].Value = Customer.ObtenerCliente(TxtCedula.Text).Nombre;
            dataGridView1[2, dataGridView1.RowCount - 1].Value = Customer.ObtenerCliente(TxtCedula.Text).Apellido;
            dataGridView1[3, dataGridView1.RowCount - 1].Value = Customer.ObtenerCliente(TxtCedula.Text).Telefono;
            dataGridView1[4, dataGridView1.RowCount - 1].Value = Customer.ObtenerCliente(TxtCedula.Text).Cedula;
            dataGridView1[5, dataGridView1.RowCount - 1].Value = Customer.ObtenerCliente(TxtCedula.Text).Direccion;
            dataGridView1[6, dataGridView1.RowCount - 1].Value = Customer.ObtenerCliente(TxtCedula.Text).Email;
          
            
        }

        private void button2_Click(object sender, EventArgs e)
        {
            DAClientes Cliente = new DAClientes();
            Cliente.deleteCustomer(TxtCedula.Text);

        }
    }
}
